//
//  HttpClientEncryption.m
//  ITV
//
//  Created by inphase on 17/4/6.
//  Copyright © 2017年 inphase. All rights reserved.
//

#import "HttpClientEncryption.h"
#import <CommonCrypto/CommonDigest.h>


@implementation HttpClientEncryption

@end


@implementation NSString(MD5)

-(NSString *) md5String {
    const char *cStr = [self UTF8String];
    unsigned char digest[CC_MD5_DIGEST_LENGTH];
    CC_MD5( cStr, (CC_LONG)strlen(cStr), digest);
    NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH];
    for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
        [output appendFormat:@"%02x", digest[i]];
    return  [output uppercaseString];
}


@end
